#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstdio>
using namespace std;
const int N = 1e5 + 10;
int arr[N];
int s[N];
int n;
int main()
{
	int t;
	scanf("%d", &t);
	int k = 1;
	while (t--) {
		memset(arr, 0, sizeof(arr));
		memset(s, 0, sizeof(s));
		scanf("%d", &n);
		for (int i = 1; i <= n; i++) {
			scanf("%d", &arr[i]);
			s[i] = s[i - 1] + arr[i];
		}
		int mi = s[0];
		int ans = -1e9;
		int x = 0, y = 0;
		for (int i = 1; i <= n; i++) {
			if (s[i] - mi > ans) {
				ans = s[i] - mi;
				y = i;
			}
			if (mi > s[i]) {
				mi = s[i];
				x = i;
			}
		}
		printf("Case %d:\n", k++);
		printf("%d %d %d\n", ans, x + 1, y);
		if (t != 1) {
			printf("\n");
		}
	}
	return 0;
}